package com.tarena.spring.test.conditional;

import com.tarena.spring.test.bean.Bean02;
import com.tarena.spring.test.bean.Bean03;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.context.annotation.Configuration;

@Configuration
//@ConditionalOnMissingClass(value={"com.tarena.spring.test.bean.Bean09"})
@ConditionalOnMissingBean(Bean03.class)
public class ConditionalDemo01Config {
    //通过扫描加载这个配置类 只判断是否满足条件
    public ConditionalDemo01Config() {
        System.out.println("条件满足,condition-demo01被容器加载");
    }
}
